#ifndef __CM_MEDIA_PIN_H__
#define __CM_MEDIA_PIN_H__

#include "Common.h"

using Poco::RefCountedObject;

namespace cm_media
{
    class Filter;

    class Pin: public RefCountedObject
    {
    public:
        Pin(PinDirection dir);
        
        int connect( Pin* p_peer );
        int receiveConnect(Pin* p_peer );
        int receiveDisconnect();
        int disconnect();
        bool isConnected();

        int setPeer(Pin* p_peer);
        Pin* getPeer();

        MediaType getMediaType();

        PinDirection getDirection();

        Filter* getParent();

    protected:
        virtual ~Pin();
    protected:
        Pin* m_peer;
        Filter* m_parent;
        MediaType m_type;
        PinDirection m_direction;
        bool m_isConnected;
    };

    typedef std::list<Pin*> PinList;

}//cm_media
#endif //__CM_PIN_H__